<{include file="tpl/header.html"}>

<{if $is_ok}>
	<p class="notice notice_succeed">恭喜您，申请成功！</p>
<{/if}>

<div class="intro_header">加入学组</div>
<form id="join-form" action="<{spUrl c=join a=index}>" method="POST">	
	<p style="border:none;">
		<label for="name">姓名:</label>
		<input type="text" name="name" id="name" required>
		<span class="required">*</span>
	</p>
	<p>
		<label for="phone">电话:</label>
		<input type="text" name="phone" id="phone" required>
		<span class="required">*</span>
	</p>

	<p>
		<label for="email">邮箱:</label>
		<input type="email" name="email" id="email" required>
		<span class="required">*</span>
	</p>
	<p>
		<label for="unit">单位:</label>
		<input type="text" name="unit" id="unit" required>
		<span class="required">*</span>
	</p>
	<p>
		<label for="intro">研究领域:</label>
		<textarea name="intro" id="intro"></textarea>
	</p>

	<p>
		<label for="submit">  </label>
		<input type="submit" name="submit" value="申请加入" class="button" style="margin-left:70px;width:210px;">
	</p>
</form>
<div style="width:420px;float:right;border-left:1px solid #eee;padding:20px;">
	<{$result['page'][0][0]["description"]}>
</div>

<div class="clear"></div>
<script type="text/javascript">
	$('input[name=submit]').click(function(){
		var name = $('input[name=name]').val();
		var phone = $('input[name=phone]').val();
		var email = $('input[name=email]').val();
		var unit = $('input[name=unit]').val();
		var err_msg = "";

		var szReg=/^([a-za-z0-9_-])+@([a-za-z0-9_-])+(.[a-za-z0-9_-])+/; 

		if(name == ""){
			err_msg = "姓名不能为空";
		}else if(phone == "" || phone.length != 11){
			err_msg = "电话格式不正确";
		}else if(email == "" || !szReg.test(email)){
			err_msg = "邮箱格式不正确";
		}else if(unit == ""){
			err_msg = "单位不能为空";
		}

		if(err_msg != ""){
			alert(err_msg);
			return false;
		}
	});

</script>
<{include file="tpl/footer.html"}>